package cn.javass.test.service.impl;

import java.util.List;

import cn.javass.framework.aop.annotation.IInterceptor;
import cn.javass.framework.aop.transaction.TransactionManagerInterceptor;
import cn.javass.framework.ioc.annotation.IInject;
import cn.javass.framework.ioc.annotation.IService;
import cn.javass.framework.ioc.annotation.Scope;
import cn.javass.test.dao.UserDao;
import cn.javass.test.interceptor.MyInterceptor;
import cn.javass.test.model.UserModel;
import cn.javass.test.service.UserService;


@IService(id="userService")
public class UserServiceImpl implements UserService{
	
	@IInject(id="userDao")
	private UserDao userDao ;
	

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
	@IInterceptor(classes={MyInterceptor.class,TransactionManagerInterceptor.class})
	@Override
	public boolean delete(UserModel um) {
		return this.userDao.delete(um);
	}
	@IInterceptor(classes={MyInterceptor.class,TransactionManagerInterceptor.class})
	@Override
	public List<UserModel> getAll(UserModel um) {
		return this.userDao.getAll(um.getClass());
	}
	@IInterceptor(classes={MyInterceptor.class,TransactionManagerInterceptor.class})
	@Override
	public boolean save(UserModel um) {
		return this.userDao.save(um);
	}

}
